<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>顶部</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"></script>
</head>
<body>
	<div class="content-topbar flex-sb-m h-full container">
		<c:choose>
			<c:when test="${empty sessionScope.user}">
				<div class="left-top-bar">标准订单满 100 元免运费</div>
				<div class="right-top-bar flex-w h-full">
					<a href="#" class="flex-c-m trans-04 p-lr-25"> 帮助&常见问题 </a> 
					<a href="#" data-toggle="modal" data-target="#myModal" class="flex-c-m trans-04 p-lr-25"> 登录</a> 
					<a href="#" data-toggle="modal" data-target="#myModal2" class="flex-c-m trans-04 p-lr-25"> 注册 </a>
				</div>
			</c:when>
			<c:otherwise>
				<div class="left-top-bar">标准订单满 100 元免运费</div>
				<div class="right-top-bar flex-w h-full">
					<a href="#" class="flex-c-m trans-04 p-lr-25"> 帮助&常见问题 </a> 
					<a href="#" class="flex-c-m trans-04 p-lr-25">您好！欢迎，${sessionScope.user.m_user}来购物 </a> 
					<a href="javascript:void(0)" onclick="outLogin()" class="flex-c-m trans-04 p-lr-25"> 退出登入 </a>
				</div>
			</c:otherwise>
		</c:choose>
	</div>
</body>
<script type="text/javascript">
	//退出功能
	function outLogin(){
		$.post('${pageContext.request.contextPath}/member/outLogin',
				function(res){
					if(res){
						layer.confirm("你确定退出么？",function(index){
							window.location.href="${pageContext.request.contextPath}/html/index.jsp"
						});
					}
		}
		,'json');
	}
</script>
</html>